package com.example.mos4_1;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

import java.util.Date;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_project_progress);
        Date date = new Date();
        date.setTime(System.currentTimeMillis());
        date.setYear(2020);
        int monthDays = DateTools.getMonthDays(2020,2);
        System.out.println("2月份有"+monthDays+"天");
        System.out.println("今天是2月"+date.getDate()+"号");
        ProjectProgressView projectProgressView = findViewById(R.id.pp);
//        ProjectProgressView projectProgressView1 = findViewById(R.id.pp2);
//        ProjectProgressView projectProgressView2 = findViewById(R.id.pp3);
//        ProjectProgressView projectProgressView3 = findViewById(R.id.pp4);
//        ProjectProgressView projectProgressView4 = findViewById(R.id.pp5);
//        ProjectProgressView projectProgressView5 = findViewById(R.id.pp6);
//        ProjectProgressView projectProgressView6 = findViewById(R.id.pp7);
//        ProjectProgressView projectProgressView7 = findViewById(R.id.pp8);
        Date date1 = new Date();
        date1.setYear(2019);
        date1.setMonth(6);
        date1.setDate(15);
        Date date2 = new Date();
        date2.setYear(2020);
        date2.setMonth(6);
        date2.setDate(15);
        Date date3 = new Date();
        date3.setYear(2020);
        date3.setMonth(4);
        date3.setDate(15);
        Date date4 = new Date();
        date4.setYear(2020);
        date4.setMonth(3);
        date4.setDate(1);
        Date date5 = new Date();
        date5.setYear(2019);
        date5.setMonth(8);
        date5.setDate(12);
        Date date6 = new Date();
        date6.setYear(2019);
        date6.setMonth(9);
        date6.setDate(10);
        Date date7 = new Date();
        date7.setYear(2019);
        date7.setMonth(7);
        date7.setDate(10);
        projectProgressView.setProgressMaxWidth(date1,date2);
        projectProgressView.setDateArea(date1,date3,date,date);
//        projectProgressView1.setProgressMaxWidth(date1,date2);
//        projectProgressView1.setDateArea(date5,date3,date,date);
//        projectProgressView2.setProgressMaxWidth(date1,date2);
//        projectProgressView2.setDateArea(date5,date3,date,date);
//        projectProgressView3.setProgressMaxWidth(date1,date2);
//        projectProgressView3.setDateArea(date5,date3,date,date);
//        projectProgressView4.setProgressMaxWidth(date1,date2);
//        projectProgressView4.setDateArea(date5,date3,date,date);
//        projectProgressView5.setProgressMaxWidth(date1,date2);
//        projectProgressView5.setDateArea(date5,date3,date,date);
//        projectProgressView6.setProgressMaxWidth(date1,date2);
//        projectProgressView6.setDateArea(date7,date3,date,date);
//        projectProgressView7.setProgressMaxWidth(date1,date2);
//        projectProgressView7.setDateArea(date6,date3,date,date);
    }
}
